<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="/WEB-INF/tlds/nodes-faces.tld" prefix="n" %>

<f:subview id="htmlContent">

    <div id="content">
        <n:stream content="#{HtmlBean.content}"/>
    </div>

    &nbsp;&nbsp;
    <h:inputHidden value="#{DataBean.nodesManager.pageStart}"/>
    <h:dataTable value="#{DataBean.nodesManager.result}" styleClass="table" captionClass="dheading1" headerClass="header" rowClasses="even,odd" var="node" columnClasses="icon,firstColumn,secondColumn"
                 rendered="#{DataBean.nodesManager.notEmpty}">
        <f:facet name="caption">
            <h:outputText value="#{msg.dataNodes}"/>
        </f:facet>

        <h:column>
            <f:facet name="header">
                <h:outputText value=""/>
            </f:facet>
            <h:graphicImage value="#{NodesBean.repositoryPath}?nodeType=#{node.primaryNodeType.name}&contentType=#{DataBean.iconContentType}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="#{msg.dataNodesName}" />
            </f:facet>
            <h:outputLink value="#{NodesBean.repositoryPath}#{node.path}">
                <h:outputText value="#{node.name}" styleClass="table"/>
            </h:outputLink>
        </h:column>
        <h:column>
            <f:facet name="header">
                <h:outputText value="#{msg.dataNodesType}" />
            </f:facet>
            <h:outputLink value="#{NodesBean.repositoryPath}#{node.path}?contentType=data">
                <h:outputText value="#{node.primaryNodeType.name}" styleClass="table"/>
            </h:outputLink>
        </h:column>
    </h:dataTable>

    <h:panelGroup rendered="#{DataBean.nodesManager.pager.pagingRequired}">
        <h:commandLink actionListener="#{DataBean.nodesManager.pager.first}">
            <h:graphicImage value="#{NodesBean.imagePath}/start.png"/>
        </h:commandLink>
        &nbsp;
        <h:commandLink actionListener="#{DataBean.nodesManager.pager.previous}">
            <h:graphicImage value="#{NodesBean.imagePath}/previous.png"/>
        </h:commandLink>
        &nbsp;
        <h:commandLink actionListener="#{DataBean.nodesManager.pager.next}">
            <h:graphicImage value="#{NodesBean.imagePath}/next.png"/>
        </h:commandLink>
        &nbsp;
        <h:commandLink actionListener="#{DataBean.nodesManager.pager.last}">
            <h:graphicImage value="#{NodesBean.imagePath}/end.png"/>
        </h:commandLink>
    </h:panelGroup>

</f:subview>